
malloc3.o:     file format elf64-littleaarch64


Disassembly of section .text:

0000000000000000 <main>:
#include <stdlib.h>

#define ONE_K (1024)

int main()
{
   0:	a9bd7bfd 	stp	x29, x30, [sp, #-48]!
   4:	910003fd 	mov	x29, sp
  char * some_memory;
  int size_to_allocate = ONE_K;
   8:	52808000 	mov	w0, #0x400                 	// #1024
   c:	b90027a0 	str	w0, [x29, #36]
  int megs_obtained = 0;
  10:	b9002fbf 	str	wzr, [x29, #44]
  int ks_obtained = 0;
  14:	b9002bbf 	str	wzr, [x29, #40]

  while (1) {
    for (ks_obtained = 0; ks_obtained < 1024; ks_obtained++) {
  18:	b9002bbf 	str	wzr, [x29, #40]
  1c:	14000014 	b	6c <main+0x6c>
      some_memory = (char *)malloc(size_to_allocate);
  20:	b98027a0 	ldrsw	x0, [x29, #36]          ; size_to_allocate
  24:	94000000 	bl	0 <malloc>
  28:	f9000fa0 	str	x0, [x29, #24] ; some_memory
      if (some_memory == NULL)
  2c:	f9400fa0 	ldr	x0, [x29, #24]
  30:	f100001f 	cmp	x0, #0x0
  34:	54000061 	b.ne	40 <main+0x40>  // b.any
	exit(EXIT_FAILURE);
  38:	52800020 	mov	w0, #0x1                   	// #1
  3c:	94000000 	bl	0 <exit>
      sprintf(some_memory, "hello world");
  40:	f9400fa2 	ldr	x2, [x29, #24]   ; x2 = some_memory
  44:	90000000 	adrp	x0, 0 <main>
  48:	91000001 	add	x1, x0, #0x0 ; x1 = "hello world"
  4c:	aa0203e0 	mov	x0, x2  ; x0 = some_memory
  50:	f9400022 	ldr	x2, [x1] ; x2 = "hello world"
  54:	f9000002 	str	x2, [x0] ; some_memory = "hello world"
  58:	b9400821 	ldr	w1, [x1, #8] ; w1 = x1 + 8 = parameter + 8      ?????
  5c:	b9000801 	str	w1, [x0, #8] ; some_memory + 8 = parameter + 8  ?????
    for (ks_obtained = 0; ks_obtained < 1024; ks_obtained++) {
  60:	b9402ba0 	ldr	w0, [x29, #40]
  64:	11000400 	add	w0, w0, #0x1
  68:	b9002ba0 	str	w0, [x29, #40]
  6c:	b9402ba0 	ldr	w0, [x29, #40]
  70:	710ffc1f 	cmp	w0, #0x3ff
  74:	54fffd6d 	b.le	20 <main+0x20>
    }

    megs_obtained++;
  78:	b9402fa0 	ldr	w0, [x29, #44]
  7c:	11000400 	add	w0, w0, #0x1
  80:	b9002fa0 	str	w0, [x29, #44]
    printf("Now allocated %d Megabytes\n", megs_obtained);
  84:	90000000 	adrp	x0, 0 <main>
  88:	91000000 	add	x0, x0, #0x0
  8c:	b9402fa1 	ldr	w1, [x29, #44]
  90:	94000000 	bl	0 <printf>
    for (ks_obtained = 0; ks_obtained < 1024; ks_obtained++) {
  94:	17ffffe1 	b	18 <main+0x18>
